<div class="center">
    <div class="home">
        <div class="home_left">
            <?php echo $this->partial('member/menu.phtml',array('uCount' => $this->uCount,'menuId'=>$this->menuId,'user'=>$this->user,'account'=>$this->account)); ?>
        </div>
        <div class="home_right">
            <div class="weizhi">
                <h2><a href="/member/mystore">我的云仓库</a>
                    <i>&gt;</i>物品详情<input type="hidden" id="productName" name="productName" value="<?php echo $this->storeItem->RemarkName?$this->storeItem->RemarkName:$this->storeItem->ProductName;?>"></h2>
            </div>
            <div class="wpxtop" style="text-align: center;">
                <h1><a href="javascript:void(0)" class="indexa editRemarkName"><?php echo $this->storeItem->RemarkName?$this->storeItem->RemarkName:$this->storeItem->ProductName;?></a></h1>
            </div>
            <div class="wpxnr">
                <div class="wpleft">
                    <div class="wph1">
                        <h2>物品信息</h2>
                    </div>
                    <div class="wpbiao">
                        <table>
                            <tr>
                                <td class="wl">仓库单号：</td>
                                <td><?php echo $this->storeItem->Barcode;?></td>
                            </tr>
                            <tr>
                                <td class="wl">包裹类型：</td>
                                <td><?php echo $this->storeItem->Intype;?></td>
                            </tr>
                            <tr>
                                <td class="wl">物品净重：</td>
                                <td><?php echo $this->storeItem->Weight/1000;?>kg</td>
                            </tr>
                            <tr>
                                <td class="wl">体积重量：</td>
                                <td><?php echo $this->storeItem->VolumeWeight/1000;?>kg
                                    <?php echo ($this->storeItem->Length&&$this->storeItem->Width&&$this->storeItem->height)?"(".$this->storeItem->Length."*".$this->storeItem->Width."*".$this->storeItem->height.")":"";?></td>
                            </tr>
                        </table>
                    </div>
                    <div class="wpbiao">
                        <table>
                            <tr>
                                <td class="wl">快递公司：</td>
                                <td><?php echo $this->storeItem->LogisticsName?$this->storeItem->LogisticsName:$this->storeItem->Logistics; ?>
                                    <?php if($this->storeItem->cnShipFee>0){?><span class="daofu">(到付：<?php echo $this->storeItem->cnShipFee;?>元)</span><?php } ?></td>
                            </tr>
                            <tr>
                                <td class="wl">快递单号：</td>
                                <td><?php echo $this->storeItem->Logistics;?></td>
                            </tr>
                        </table>
                    </div>
                    <div class="wpbiao nobk">
                        <table>
                            <tr>
                                <td class="wl">物品特征：</td>
                                <td id="itemType_td">
                                    <div class="tez">
                                        <ul>
                                        <?php if($this->storeItem->IsEmbargo){?>
                                            <li>
                                                <div class="itemType" style="height:40px;">
                                                    <a class="tz6" href="javascript:void(0)">禁运</a>
                                                    <div class="tc" style="display:none">
                                                        <div class="jtou"></div>
                                                        <p>此物品各大快递均不接收运送，详情请咨询悠奇客服</p>
                                                    </div>
                                                </div>
                                            </li>
                                        <?php } ?>
                                        <?php if($this->storeItem->BignessType &&$this->storeItem->BignessType >0){?>
                                            <li>
                                                <div class="itemType" style="height:40px;">
                                                    <a class="tz1" href="javascript:void(0)">抛货</a> 
                                                    <div class="tc" style="display:none">
                                                        <div class="jtou"></div>
                                                        <p>此商品体积较大，当使用DHL、UPS、Fedex时需按体积重量结算运费。   <a href="http://help.uuch.com/?p=268" target="_blank">什么是体积重量？</a></p>
                                                        <p>EMS和邮政小包按实际重量结算</p>
                                                    </div>
                                                </div>
                                            </li>
                                        <?php } ?>
                                        <?php foreach(Application_Model_StoreItem::getNames() as $key=>$value){
                                            if($key != 0 && ($this->storeItem->ItemType & $key) == $key){
                                            ?>
                                            <li>
                                                <div class="itemType" style="height:40px;">
                                                    <a class="<?php echo $value[1];?> itemType" href="javascript:void(0)"><?php echo $value[0];?></a>
                                                    <div class="tc" style="display:none">
                                                        <div class="jtou"></div>
                                                        <p><?php echo $value[2];?></p>
                                                    </div>
                                                </div>
                                            </li>
                                        <?php  }
                                          }echo ($this->storeItem->ItemType == 0)?"<li>正常</li>":"";
                                        ?>
                                    	
                                    </ul>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="wpright">
                    <div class="ztbox">
                        <i></i>
                        <div class="wpzt">
                            <h2 class="f60">物品状态：<?php echo $this->storeItem->StatusName; ?></h2>
                            <p>入库时间：<?php echo $this->storeItem->dateInStore;?></p>
                            <p>出库时间：<?php echo $this->storeItem->dateOut?$this->storeItem->dateOut:"暂无";?></p>
                            <p>运单编号：<?php if($this->storeItem->waybillinfo && $this->storeItem->State == Application_Model_StoreItem::STATUS_Sended){?>
                                <a href="/member/waybillinfo/?id=<?php echo $this->storeItem->waybillinfo->id; ?>">
                                <?php echo $this->storeItem->waybillinfo->billNo; ?>
                            </a><?php } else {echo "暂无";}?></p>
                        </div>
                    </div>
                </div>
            </div>
            <?php if($this->storeItem->Intype != "代购订单"){?>
                <div class="zizhuwupin">
                    <div class="lmb">
                        <h2>物品清单</h2>
                    </div>
                    <div class="wpnr">
                        <p><?php echo $this->storeItem->remark; ?></p>
                    </div>
                </div>
            
            <?php } else { ?>
            <div class="daigouxinfo">
                <div class="lmb">
                    <h2>代购物品</h2>
                </div>
                <div class="daigouwupin">
                    <div class="dd_info"><span>代购订单编号：<a href="/member/myorder">
                        <?php echo $this->storeItem->orderItem->OrderNum;?></a></span><span>时间：<?php echo $this->storeItem->orderItem->dateCreated;?></span></div>
                    <table class="NewDD">
                        <tr>
                            <th class="l1">商品信息</th>
                            <th class="l2">价格</th>
                            <th class="l3">数量</th>
                            <th class="l4">说明</th>
                        </tr>
                        <?php $shopDetail = $this->storeItem->orderItem->shipdetail;
                            foreach ($shopDetail as $shopVal) {
                                $productd = $shopVal->byproductd;
                        ?>
                        <tr>
                            <td class="l1">
                                <div class="sp_pic">
                                    <a href="<?php echo $shopVal->taoBaoUrl?$shopVal->taoBaoUrl:$productd->url; ?>" target="_blank">
                                        <img src="<?php echo $productd->image ? $productd->image : $productd->remoteImage; ?>" width="50px" height="50px" style="vertical-align:middle;"/></a>
                                </div>
                                <div class="sp_info">
                                    <h1><a href="<?php echo $shopVal->taoBaoUrl?$shopVal->taoBaoUrl:$productd->url; ?>" target="_blank" class="indexa"><?php echo $shopVal->productName; ?></a></h1>
                                    <div class="zdy">
                                        <span><?php echo $productd->PropertyAlias; ?></span>
                                    </div>
                                    <div class="Remarks">
                                        <p>商品备注:<?php echo $shopVal->comment ? $shopVal->comment : "(无)"; ?></p>
                                    </div>
                                </div>
                            </td>
                            <td class="l2"><?php echo $shopVal->price;?></td>
                            <td class="l3"><?php echo $shopVal->quantity;?></td>
                            <td class="l4"><?php 
                                            if($shopVal->problemContent != null && $shopVal->problemContent != ""){
                                                echo '<span class="c00">'.$shopVal->problemContent.'</span>';
                                            } else {
                                                echo $shopVal->status==1?"已单项退款":"已验";
                                            } ?></td>
                        </tr>
                        <?php } ?>
                    </table>
                </div>
            </div>
            <?php } ?>
            <?php if($this->storeItem->ProblemInfo && $this->storeItem->ProblemInfo->problemContent != ""){ ?>
                <div class="zizhuwupin">
                    <div class="lmb">
                        <h2>问题内容</h2>
                    </div>
                    <div class="wpnr">
                        <p <?php echo ($this->storeItem->ProblemInfo->isAbnormal == Application_Model_Order::Abnormal_Solve)?"style='color:#f60;'":"style='color:#c00;'";?>><?php echo $this->storeItem->ProblemInfo->problemContent; ?></p>
                        <?php echo ($this->storeItem->ProblemInfo->isAbnormal == Application_Model_Order::Abnormal_Solve)?"<p style='color:#c00;'>已解决</p>":"";?>
                    </div>
                </div>
            <?php  }?>
            <div class="photo">
                <div class="lmb">
                    <h2>入库实拍</h2>
                    <span style="display: none;">+ 多图</span>
                </div>
                <div class="photobox">
                    <p><a href="<?= $this->cdn ?><?= !is_int(strpos('big',$this->storeItem->imageFile))?('/big'.$this->storeItem->imageFile):($this->storeItem->imageFile) ?>"  target="_blank">
        <img src="<?= $this->cdn ?><?= !is_int(strpos('big',$this->storeItem->imageFile))?('/big'.$this->storeItem->imageFile):($this->storeItem->imageFile) ?>" style="vertical-align:middle;"/></a></p> 
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
  $(".itemType").hover(function(){
        $(".tc",this).show();
  },function(){
        $(".tc",this).hide();
  });
  $(".editRemarkName").live("click",function(){
        var productName = $("#productName").val();
        var html = "<span style='font-size:14px;'>修改商品名称：<input type='type' id='remarkName' name='remarkName' value='"+productName+"' style='font-size:14px;width:250px;'>";
        html += "&nbsp;&nbsp;<a href='javascript:void(0)' class='indexa editName'>修改</a>";
        html += "&nbsp;&nbsp;<a href='javascript:void(0)' class='indexa reqx'>取消</a></span>";
        $(".wpxtop").html(html);
  });
  $(".reqx").live("click",function(){
        var productName = $("#productName").val();
        var html = '<h1><a href="javascript:void(0)" class="indexa editRemarkName">'+productName+'</a></h1>';
        $(".wpxtop").html(html);
  });
  $(".editName").live("click",function(){
        var remarkName = $("#remarkName").val();
        if(remarkName == ""){
            alert("修改后的名称不能为空！");
            return false;
        }
        if(confirm("您确定修改该商品的名称？","提示信息")){ 
            $.ajax({
                 type: 'POST',
                 url: "/member/editstorename/id/<?php echo $this->storeItem->Id;?>/remarkName/"+remarkName,
                 success: function(data) {
                     if(data == 1){
                         $("#productName").val(remarkName);
                         $(".reqx").click();
                     } else {
                         alert("出现未知错误，请刷新页面重试或在线联系客服！");
                     }
                 }
            });
        }
  });
</script>  